package pe.gob.onpe.facade.local;

import java.util.List;
import javax.ejb.Local;

import pe.gob.onpe.ejb.ParticipacionListaCandidatos;
import pe.gob.onpe.ejb.Voto;
import pe.gob.onpe.ejb.id.VotoId;


/**
 * Local interface for VotoFacade.
 * 
 * @author MyEclipse Persistence Tools
 */
@Local
public interface VotoFacadeLocal {
	/**
	 * Perform an initial save of a previously unsaved Voto entity. All
	 * subsequent persist actions of this entity should use the #update()
	 * method.
	 * 
	 * @param entity
	 *            Voto entity to persist
	 * @throws RuntimeException
	 *             when the operation fails
	 */
	public void save(Voto entity);

	/**
	 * Delete a persistent Voto entity.
	 * 
	 * @param entity
	 *            Voto entity to delete
	 * @throws RuntimeException
	 *             when the operation fails
	 */
	public void delete(Voto entity);

	/**
	 * Persist a previously saved Voto entity and return it or a copy of it to
	 * the sender. A copy of the Voto entity parameter is returned when the JPA
	 * persistence mechanism has not previously been tracking the updated
	 * entity.
	 * 
	 * @param entity
	 *            Voto entity to update
	 * @returns Voto the persisted Voto entity instance, may not be the same
	 * @throws RuntimeException
	 *             if the operation fails
	 */
	public Voto update(Voto entity);

	public Voto findById(VotoId id);

	/**
	 * Find all Voto entities with a specific property value.
	 * 
	 * @param propertyName
	 *            the name of the Voto property to query
	 * @param value
	 *            the property value to match
	 * @param rowStartIdxAndCount
	 *            Optional int varargs. rowStartIdxAndCount[0] specifies the the
	 *            row index in the query result-set to begin collecting the
	 *            results. rowStartIdxAndCount[1] specifies the the maximum
	 *            count of results to return.
	 * @return List<Voto> found by query
	 */
	public List<Voto> findByProperty(String propertyName, Object value,
			int... rowStartIdxAndCount);

	/**
	 * Find all Voto entities.
	 * 
	 * @param rowStartIdxAndCount
	 *            Optional int varargs. rowStartIdxAndCount[0] specifies the the
	 *            row index in the query result-set to begin collecting the
	 *            results. rowStartIdxAndCount[1] specifies the the maximum
	 *            count of results to return.
	 * @return List<Voto> all Voto entities
	 */
	public List<Voto> findAll(int... rowStartIdxAndCount);

	public void registrarVoto(VotoId votoId, ParticipacionListaCandidatos participacionListaCandidatos);

	public Long cantidadVotosPorProceso(Long procesoElectoralId);

	public Long cantidadVotosPorTipoEleccion(Long procesoElectoralId,
			Long tipoEleccionId);
}